package com.xu.cloud.auth.component;

import com.xu.cloud.common.auth.AuthContext;

/**
 * token组件
 *
 * @author xuguan
 * @since 2025/2/23
 */
public interface TokenComponent {

    /**
     * 创建access_token
     */
    String createAccessToken(AuthContext authContext);

    /**
     * 解析access_token
     */
    AuthContext resolveAccessToken(String accessToken, boolean delete);

    /**
     * 刷新access_token, 生成新的access_token
     */
    String refreshAccessToken(String accessToken);

    /**
     * 续期access_token
     */
    void extendAccessToken(String accessToken);

    /**
     * 删除access_token
     */
    void deleteAccessToken(String accessToken);

    /**
     * 校验messageCodeToken
     */
    void checkMessageCodeToken(String messageCodeToken, String mobileNo);
}
